package com.wtpaint.lib.zhttp;

public class HttpClient {

    private Dispatcher dispatcher;

    public HttpClient(Builder builder) {
        dispatcher = builder.dispatcher;
    }

    public Dispatcher dispatcher() {
        return dispatcher;
    }

    public Call newCall(Request request) {
        return new Call(request, this);
    }

    public static final class Builder {
        private Dispatcher dispatcher;

        public Builder dispatcher(Dispatcher dispatcher) {
            this.dispatcher = dispatcher;
            return this;
        }

        public HttpClient builder() {
            return new HttpClient(this);
        }
    }
}
